package totalSearch;

import common.db.DBExecute;
import common.main.MainBean;

public class ProductSearchBean extends MainBean
{
	public void funcExecute() throws Exception
	{
		String title = (String)inputTable.get("word");
		Integer unitStartNum = (Integer)inputTable.get("unitStartNum");
		Integer unitEndNum = (Integer)inputTable.get("unitEndNum");
		
		queryBuffer = new StringBuffer();
		
		queryBuffer.append("SELECT C.COUNT, C.SEQ, C.NAME, C.PRICE, C.INFO, C.PATH ");
		queryBuffer.append("FROM ( SELECT ROWNUM COUNT, A.SEQ, A.NAME, A.PRICE, A.INFO, B.PATH ");
		queryBuffer.append("FROM ( SELECT NAME, PRICE, INFO, SEQ FROM GOODS WHERE NAME LIKE '%"+title+"%' AND USEYN='Y' ");
		queryBuffer.append(") A, GOODS_IMAGE B WHERE B.GOODS_SEQ(+) = A.SEQ ) C WHERE C.COUNT >="+unitStartNum+" AND C.COUNT<="+unitEndNum);
		
		
		DBExecute dbe = new DBExecute(queryBuffer.toString());
		
		outputList = dbe.getDataList();
	}
}
